package com.ssq;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import com.ssq.common.Config;
import com.ssq.common.Utils;
import com.ssq.redballs.PrevIssueArithmetic;

public class main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String currentIssue = Config.getValue("currentIssue");
		System.out.println("当前期："+currentIssue);
		
//		PrevIssueArithmetic pia = new PrevIssueArithmetic();
//		int[] test = pia.generateSelect();
//		for (int i = 0; i < test.length; i++) {
//			System.out.print(test[i]+" ");
//		}
		
		//--统计最近10期的准确率

		for (int i = 0; i < 10; i++) {
			String issueNum = Utils.PrevIssueNum(i+2);
			PrevIssueArithmetic piaTemp = new PrevIssueArithmetic(issueNum);
			piaTemp.generateSelect();
		}
		//PrevIssueArithmetic pTemp = new PrevIssueArithmetic();
		Map<Integer, Integer> map = PrevIssueArithmetic.statMap;

//		for (Integer key:map.keySet()) {
//			System.out.println(key+" : "+map.get(key));
//		}
		
		
		List<Map.Entry<Integer, Integer>> infoIds = new ArrayList<Map.Entry<Integer, Integer>>(map.entrySet());

		//排序
		Collections.sort(infoIds, new Comparator<Map.Entry<Integer, Integer>>() {
			public int compare(Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2) {
				return (o1.getKey() - o2.getKey());
			}
		}); 
		
		for (int i = 0; i < infoIds.size(); i++) {
			String id = infoIds.get(i).toString();
			System.out.println(id);
		} 
		//-- 书写junit测试
		
		//-- 测试前10期每种算法的准确率
		
		//-- 根据准确率使用算法

	}
	
	

}
